#pragma once
#include "IniWrapper.h"

namespace SD_Tools
{
	//************************************
	// Method:    LoadBool
	// Profit:	  Loads a bool from an ini file
	// FullName:  SD_Tools::AbstractIni::LoadBool
	// Returns:   bool
	// Notes:
	// -returns false upon failure
	//************************************
	bool AbstractIni::LoadBool( char* FilePath, char* Section, char* Name, bool* Out )
	{
		char Buffer[256];
		GetPrivateProfileStringA(Section, Name, "ERROR", Buffer, sizeof(Buffer), FilePath);
		if (strcmp(Buffer, "ERROR") == 0)
		{
			return false;
		}
		else
		{
			*Out = (atoi(Buffer) == 1);
			return true;
		}
	}
};